package com.example.xftest.controller;

import com.example.xftest.entity.Job;
import com.example.xftest.mapper.JobDao;
import com.example.xftest.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Controller
@RequestMapping("/job")
public class JobController {

    @Autowired
    JobService jobService;

    @RequestMapping("/select")
    public List<Job> select() {
        return jobService.select();
    }

    @RequestMapping("/add")
    public int add(Job job) {
        return jobService.add(job);
    }

    @RequestMapping("/delete")
    public int delete(int id) {
        return jobService.delete(id);
    }

    @RequestMapping("/update")
    public int update(Job job) {
        return jobService.update(job);
    }
}
